<style>
.w-e-text-container *, .w-e-toolbar * {
  white-space: normal;
}
</style>

<template>
  <div>
    <z-space vertical>
      <wang-editor></wang-editor>
    </z-space>
  </div>
</template>

<script>
import { Boot } from '@wangeditor/editor'
import ctrlEnterModule from './index.js'
// console.log(ctrlEnterModule)
// Boot.registerModule(ctrlEnterModule)

import { h } from 'snabbdom'

// 渲染函数
function renderParagraph(elem, children, editor) {
  // elem 即当前节点
  // children 是下级节点
  // editor 即编辑器实例

  const vnode = h('div', {
    dataset: {
      set: 'question'
    }
  }, children) // type: 'paragraph' 节点，即渲染为 <p> 标签
  return vnode
}

// 渲染配置
const renderElemConf = {
  type: 'question', // 节点 type ，重要！！！
  renderElem: renderParagraph,
}

// 注册到 wangEditor
Boot.registerRenderElem(renderElemConf)

import WangEditor from "@example/views/editor/components/WangEditor";
export default {
  components: {WangEditor},
  data() {
    return {
    }
  },
  setup() {
    return {
    }
  }
}
</script>
